//
//  GYNewShopTypeViewModel.m
//  GYDemo
//
//  Created by Mrzhang on 2018/6/29.
//  Copyright © 2018年 mac. All rights reserved.
//

#import "GYNewShopTypeViewModel.h"
#import "Head.h"


@implementation GYNewShopTypeModel
@end
@implementation GYNewShopTypeViewModel
-(instancetype)init
{
    if (self = [super init]) {
        //添加接口特殊处理
        [[InterfaceManager shareInterface].specialInterfaces addObject:@"getFirstTypeList"];
        
    }
    return self;
}
#pragma mark - getter and setter
-(NSMutableArray *)datas
{
    if (!_datas) {
        _datas = [[NSMutableArray alloc] init];
    }
    return _datas;
}

#pragma mark - method
-(void)requestDatas:(NSMutableDictionary *)para
{
    @WeakSelf;
    NSString *interface = @"getFirstTypeList";
    [[InterfaceManager shareInterface]requetInterface:interface withParameter:para handler:^(NSDictionary *info, InterfaceStatusModel *infoModel) {
        NSArray *data = infoModel.data;
        if ([data isKindOfClass:[NSArray class]])
        {
            NSMutableArray *arr =[[NSMutableArray alloc] init];
            
            for (NSDictionary *dic in data) {
                GYNewShopTypeModel *model = [GYNewShopTypeModel yy_modelWithJSON:dic];
                [arr addObject:model];
            }
            [selfp setDatas:arr];
        }
    }];
}

@end
